home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / PGUIDE / OPTIMIZE / PAINTPIC.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-09-16  |  7.3 KB  |  243 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPaintPic 
  3.    Caption         =   "Paint Picture Demo"
  4.    ClientHeight    =   1845
  5.    ClientLeft      =   4845
  6.    ClientTop       =   3645
  7.    ClientWidth     =   4320
  8.    ClipControls    =   0   'False
  9.    BeginProperty Font 
  10.       Name            =   "MS Sans Serif"
  11.       Size            =   8.25
  12.       Charset         =   0
  13.       Weight          =   700
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    ForeColor       =   &H80000008&
  19.    LinkTopic       =   "Form5"
  20.    LockControls    =   -1  'True
  21.    PaletteMode     =   1  'UseZOrder
  22.    ScaleHeight     =   1845
  23.    ScaleWidth      =   4320
  24.    Tag             =   "Apparent"
  25.    Begin VB.Timer Timer2 
  26.       Enabled         =   0   'False
  27.       Interval        =   50
  28.       Left            =   2400
  29.       Top             =   1305
  30.    End
  31.    Begin VB.CommandButton cmdAction 
  32.       Caption         =   "&Start"
  33.       BeginProperty Font 
  34.          Name            =   "MS Sans Serif"
  35.          Size            =   8.25
  36.          Charset         =   0
  37.          Weight          =   400
  38.          Underline       =   0   'False
  39.          Italic          =   0   'False
  40.          Strikethrough   =   0   'False
  41.       EndProperty
  42.       Height          =   495
  43.       Index           =   1
  44.       Left            =   3000
  45.       TabIndex        =   1
  46.       Top             =   1245
  47.       Width           =   1215
  48.    End
  49.    Begin VB.Timer Timer1 
  50.       Enabled         =   0   'False
  51.       Interval        =   500
  52.       Left            =   1560
  53.       Top             =   1305
  54.    End
  55.    Begin VB.PictureBox picMoon 
  56.       Appearance      =   0  'Flat
  57.       AutoSize        =   -1  'True
  58.       BackColor       =   &H80000005&
  59.       ForeColor       =   &H80000008&
  60.       Height          =   510
  61.       Index           =   5
  62.       Left            =   435
  63.       Picture         =   "PaintPic.frx":0000
  64.       ScaleHeight     =   480
  65.       ScaleWidth      =   480
  66.       TabIndex        =   7
  67.       Top             =   480
  68.       Visible         =   0   'False
  69.       Width           =   510
  70.    End
  71.    Begin VB.PictureBox picMoon 
  72.       Appearance      =   0  'Flat
  73.       AutoSize        =   -1  'True
  74.       BackColor       =   &H80000005&
  75.       ForeColor       =   &H80000008&
  76.       Height          =   510
  77.       Index           =   4
  78.       Left            =   375
  79.       Picture         =   "PaintPic.frx":0442
  80.       ScaleHeight     =   480
  81.       ScaleWidth      =   480
  82.       TabIndex        =   6
  83.       Top             =   405
  84.       Visible         =   0   'False
  85.       Width           =   510
  86.    End
  87.    Begin VB.PictureBox picMoon 
  88.       Appearance      =   0  'Flat
  89.       AutoSize        =   -1  'True
  90.       BackColor       =   &H80000005&
  91.       ForeColor       =   &H80000008&
  92.       Height          =   510
  93.       Index           =   3
  94.       Left            =   300
  95.       Picture         =   "PaintPic.frx":0884
  96.       ScaleHeight     =   480
  97.       ScaleWidth      =   480
  98.       TabIndex        =   5
  99.       Top             =   330
  100.       Visible         =   0   'False
  101.       Width           =   510
  102.    End
  103.    Begin VB.PictureBox picMoon 
  104.       Appearance      =   0  'Flat
  105.       AutoSize        =   -1  'True
  106.       BackColor       =   &H80000005&
  107.       ForeColor       =   &H80000008&
  108.       Height          =   510
  109.       Index           =   2
  110.       Left            =   225
  111.       Picture         =   "PaintPic.frx":0CC6
  112.       ScaleHeight     =   480
  113.       ScaleWidth      =   480
  114.       TabIndex        =   4
  115.       Top             =   255
  116.       Visible         =   0   'False
  117.       Width           =   510
  118.    End
  119.    Begin VB.PictureBox picMoon 
  120.       Appearance      =   0  'Flat
  121.       AutoSize        =   -1  'True
  122.       BackColor       =   &H80000005&
  123.       ForeColor       =   &H80000008&
  124.       Height          =   510
  125.       Index           =   1
  126.       Left            =   135
  127.       Picture         =   "PaintPic.frx":1108
  128.       ScaleHeight     =   480
  129.       ScaleWidth      =   480
  130.       TabIndex        =   3
  131.       Top             =   165
  132.       Visible         =   0   'False
  133.       Width           =   510
  134.    End
  135.    Begin VB.PictureBox picMoon 
  136.       Appearance      =   0  'Flat
  137.       AutoSize        =   -1  'True
  138.       BackColor       =   &H80000005&
  139.       ForeColor       =   &H80000008&
  140.       Height          =   510
  141.       Index           =   0
  142.       Left            =   60
  143.       Picture         =   "PaintPic.frx":154A
  144.       ScaleHeight     =   480
  145.       ScaleWidth      =   480
  146.       TabIndex        =   2
  147.       Top             =   90
  148.       Visible         =   0   'False
  149.       Width           =   510
  150.    End
  151.    Begin VB.CommandButton cmdAction 
  152.       Caption         =   "&Start"
  153.       BeginProperty Font 
  154.          Name            =   "MS Sans Serif"
  155.          Size            =   8.25
  156.          Charset         =   0
  157.          Weight          =   400
  158.          Underline       =   0   'False
  159.          Italic          =   0   'False
  160.          Strikethrough   =   0   'False
  161.       EndProperty
  162.       Height          =   495
  163.       Index           =   0
  164.       Left            =   60
  165.       TabIndex        =   0
  166.       Top             =   1245
  167.       Width           =   1215
  168.    End
  169.    Begin VB.Image imgMoon 
  170.       Height          =   510
  171.       Left            =   3345
  172.       Top             =   300
  173.       Width           =   510
  174.    End
  175.    Begin VB.Label Label1 
  176.       Alignment       =   2  'Center
  177.       AutoSize        =   -1  'True
  178.       BackStyle       =   0  'Transparent
  179.       Caption         =   "Assign Images"
  180.       Height          =   195
  181.       Index           =   1
  182.       Left            =   2985
  183.       TabIndex        =   9
  184.       Top             =   1020
  185.       Width           =   1245
  186.    End
  187.    Begin VB.Label Label1 
  188.       Alignment       =   2  'Center
  189.       AutoSize        =   -1  'True
  190.       BackStyle       =   0  'Transparent
  191.       Caption         =   "Paint Picture"
  192.       Height          =   195
  193.       Index           =   0
  194.       Left            =   60
  195.       TabIndex        =   8
  196.       Top             =   1020
  197.       Width           =   1215
  198.    End
  199. Attribute VB_Name = "frmPaintPic"
  200. Attribute VB_GlobalNameSpace = False
  201. Attribute VB_Creatable = False
  202. Attribute VB_TemplateDerived = False
  203. Attribute VB_PredeclaredId = True
  204. Attribute VB_Exposed = False
  205. Option Explicit
  206. Private Sub cmdAction_Click(Index As Integer)
  207. Dim iMaxHeight As Integer, iMaxWidth As Integer
  208. Dim ipicHeight As Integer, iPicWidth As Integer
  209. Dim ipicLeft As Integer, ipicTop As Integer, i As Integer
  210. If cmdAction(Index).Caption = "&Start" Then
  211.   If Index = 0 Then
  212.     Timer1.Interval = 20
  213.     Timer1.Enabled = True
  214.   Else
  215.     Timer2.Interval = 20
  216.     Timer2.Enabled = True
  217.   End If
  218.   cmdAction(Index).Caption = "&Stop"
  219.   If Index = 0 Then
  220.     Timer1.Enabled = False
  221.   Else
  222.     Timer2.Enabled = False
  223.   End If
  224.   cmdAction(Index).Caption = "&Start"
  225. End If
  226. End Sub
  227. Private Sub Form_Load()
  228.   PosForm Me
  229.   Me.Show
  230. End Sub
  231. Private Sub Timer1_Timer()
  232.   Static idx As Integer
  233.   frmPaintPic.PaintPicture picMoon(idx), 400, 300
  234.   idx = idx + 1
  235.   If idx > 5 Then idx = 0
  236. End Sub
  237. Private Sub Timer2_Timer()
  238.   Static idx As Integer
  239.   imgMoon.Picture = picMoon(idx).Picture
  240.   idx = idx + 1
  241.   If idx > 5 Then idx = 0
  242. End Sub
  243.